import System
import ConvertService
import Useful.IO from Boo.Lang.Useful

def Main (args as (string)):
	cs = ConvertService ()

	type = args[0]
	fname = args[1]
	code = TextFile.ReadFile (fname)
	
	code2 as string
	error as string
	success = cs.PerformConversion (type, code, code2, error)

	if (not success):
		raise Exception ("Error converting code.")

	print code2
